#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import pandas as pd
import plotly.express as px
# 读取数据
df = pd.read_excel("agency_info.xlsx",sheet_name="all")
token = "你的token"
# 创建Figure对象 轨迹+画布
fig = px.scatter_mapbox(df,lon='lon',
                        lat='lat',
                        color='type',
                        text='type',
                        hover_data = ['agency_address'],
                                    # color_continuous_scale=px.colors.carto.Temps
                       )
# 更新轨迹 点大小和显示模式(点+文本)
fig.update_traces(marker_size=12,mode="markers+text")
# 更新样式
fig.update_layout(mapbox={"accesstoken":token,
                          'center':{
                              'lon':104.072329,'lat':30.65342,},
                          'style':'light',
                          'zoom':11.8},
                  margin={'l':0,'r':0,'t':20,'b':0},
                 )
# 显示画布
fig.show()
